export default{
  url:"https://api-hmugo-web.itheima.net",
  https(http={}){
    return new Promise((r,v)=>{
      wx.request({
        url:this.url+http.url,
        method:http.method||"GET",
        data:http.data||"",
        header:http.header,
        "success":(res=>{
          return r(res.data)
        }),
        "fail":(ess=>{
          return v(ess)
        })
      })
    })
  },
  get(url,method,data,http={}){
    http.url=url
    http.method=method
    http.data=data
    return this.https(http)
  },
  Post(url,method,data,header,http={}){
    http.url=url
    http.method=method
    http.data=data
    http.header=header
    return this.https(http)
  }
}